class Stack:
    def __init__(self):
        self.items = []  # 用列表存储栈元素

    def push(self, item):
        """入栈：将元素添加到栈顶"""
        self.items.append(item)

    def pop(self):
        """出栈：移除并返回栈顶元素，栈空则返回None"""
        if self.is_empty():
            return None
        return self.items.pop()

    def peek(self):
        """取栈顶：返回栈顶元素（不移除），栈空则返回None"""
        if self.is_empty():
            return None
        return self.items[-1]

    def is_empty(self):
        """判空：判断栈是否为空"""
        return len(self.items) == 0

    def size(self):
        """返回栈的大小"""
        return len(self.items)

# 测试
if __name__ == "__main__":
    stack = Stack()
    stack.push(1)
    stack.push(2)
    stack.push(3)
    print("栈顶元素:", stack.peek())  # 输出: 3
    print("出栈元素:", stack.pop())  # 输出: 3
    print("栈是否为空:", stack.is_empty())  # 输出: False
    print("栈大小:", stack.size())  # 输出: 2